package com.moon.controller;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/moon/mq")
public class MqController {
    @Autowired
    private RabbitTemplate rabbitTemplate;
    @RequestMapping("/putMq")
    @ResponseBody
    public String putMq(String info){
        rabbitTemplate.convertAndSend("DelayQ",info);
        return "success";
    }
//    @ResponseBody
//    @RequestMapping("/getMq")
//    public String getMq(){
//        String wn32Mq = jmsTemplate.receiveAndConvert("wn32Mq").toString();
//        return wn32Mq;
//    }
}
